package com.jimikongjian.dao;

import com.jimikongjian.models.ArticleRoom;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by fuxiuyang on 17-5-13.
 */
public interface IArticleRoom {

    /**
     * 通过id号，获取文章所属空间的信息
     * @param id
     * @return List<ArticleRoom>
     */
    public List<ArticleRoom> getArticleRoomListById(@Param("id") int id);

    /**
     * 插入一个新的文章到某一空间内
     * @param articleRoom
     */
    public void insertArticleRoom(ArticleRoom articleRoom);

    /**
     * 通过文章的id删除该文章内容
     * @param articleRoom
     */
    public void deleteByArticleId(ArticleRoom articleRoom);

    /**
     * 通过空间id删除该空间内的所有的文章，慎用该方法
     * @param articleRoom
     */
    public void deleteByRoomId(ArticleRoom articleRoom);

    /**
     * 通过空间id和文章id删除该空间内某一篇文章
     * @param articleRoom
     */
    public void deleteByRoomIdAndArticleId(ArticleRoom articleRoom);
}
